# 邻接矩阵的方式表示图 
# vs是点的集合 ，
# es表示边的集合
vs = ['A','B','C','D','E','F','G']
es = [[0,1,1,0,0,0,0],
     [1,0,1,1,0,0,0],
     [1,0,0,0,0,1,0],
     [0,1,0,0,0,0,1],
     [0,0,1,0,0,0,1],
     [0,0,1,0,0,1,0],
     [0,0,0,1,1,0,0]]
print('输出所有节点',end=' ')
print(vs)


# 输出所有的边 
for i in range( len(es) ):
    for j in range( len(es[i]) ):
        # es[i][j] 代表
        if es[i][j] == 1:
            print(vs[i],"->",vs[j])